<?php
namespace app\admin\controller;
use think\Controller;
use think\Session;
use think\Cache;
use think\Log;

class Index extends Common
{
    public function index()
    {

        return view();
    }






    public function LoginUot(){
            Session::delete('aid_admin');
            return json(['code'=>1,'msg'=>'注销成功','url'=>url('Login/index')]);
            //echo '<script>alert("注销成功");window.location.href="'. url('Login/index') .'";</script>';


    }

    public function Clears($t){
        switch ($t){
            case 's':
                Cache::clear();
                $this->success('数据缓存已清空');
                break;
            case 'r':
                Log::clear();
                $this->success('日志缓存已清空');
                break;
            case 't':
                array_map('unlink', glob(TEMP_PATH . '/*.php'));
                rmdir(TEMP_PATH);
                $this->success('模版缓存已清空');
                break;
        }
    }
}
